<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:composite="http://java.sun.com/jsf/composite">
    <composite:interface>
        <composite:attribute name="legend"/>        
        <composite:attribute name="width" default="90%"/>
        <composite:attribute name="position"/><!-- left, right, top-left, top-right-->
        <composite:attribute name="styleClass"/>
    </composite:interface>

    <composite:implementation>
        <c:set var="width" value="#{cc.attrs.width}"/>
        <c:if test="#{empty cc.attrs.width}">
            <c:set var="width" value="#{deltasetConfig['fieldsetWidth']}"/>
        </c:if>
        <c:set var="position" value="#{cc.attrs.position}"/>
        <c:if test="#{empty cc.attrs.position}">
            <c:set var="position" value="#{deltasetConfig['fieldsetPosition']}"/>
        </c:if>
        <fieldset id="#{cc.clientId}"  class="ds-fieldset ds-fieldset-align-#{position} #{cc.attrs.styleClass}" style="width:#{width}">
            <c:if test="#{not empty cc.attrs.legend}">
                <legend>#{cc.attrs.legend}</legend>
            </c:if>
            <composite:insertChildren/>
        </fieldset>       
    </composite:implementation>
</ui:composition>
